<admintpl file="header" />
<script type="text/javascript" src="public/js/My97DatePicker/WdatePicker.js?3"></script>

</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#" target="_self">订单管理</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('AdminOrder/index')}" onsubmit="return check_form();">
        <!--请选择时间：-->
        <!--<input type="text" name="s_start_time" id="s_start_time" onclick="start_time()" style="width: 200px;" value="{$s_start_time}"/>至-->
        <!--<input type="text" name="s_end_time" id="s_end_time" onclick="end_time()" style="width: 200px;"  value="{$s_end_time}"/>-->
        <!--<input type="hidden" id="h_start_time" value="{$s_start_time}">-->
        <!--<input type="hidden" id="h_end_time" value="{$s_end_time}">-->
        <!--&nbsp;&nbsp;-->

        ICCID:
            <input type="text" name="s_number" style="width: 200px;"  value="{$s_number}">

        所属人：
        <select name="s_uid">
        <option value="">全部</option>
        <foreach name="user_list" item="uo">
        <option value="{$uo.id}" <if condition="$uo['id'] == $s_uid">selected</if>>{$uo.user_nickname}</option>
        </foreach>
        </select>
        <input type="submit" class="btn btn-primary" value="搜索" />
    </form>
    <form class="js-ajax-form" action="" method="post">

        <table class="table table-hover table-bordered table-list">

                <thead>
                <tr>
                    <td>卡所属人</td>
                    <td>订单号</td>
                    <td>类型</td>
                    <td>卡号</td>
                    <td>iccid</td>
                    <td>流量值</td>
                    <td>价格</td>
                    <td>来源</td>
                    <td>创建时间</td>
                </tr>
                </thead>
                <foreach name="order_list" item="vo">
                    <tr>
                        <td>{$vo.user_nickname}</td>
                        <td>{$vo.order_number}</td>
                        <td>
                           {$vo.package_type}
                        </td>
                        <td>{$vo.card_number}</td>
                        <td>{$vo.card_iccid}</td>
                        <td>{$vo.package_data}</td>

                        <td>{$vo.order_price}</td>
                        <td>
                           {$vo.order_source}
                        </td>
                        <td>{$vo.create_time}</td>
                    </tr>
                </foreach>


        </table>

        <div class="pagination">{$page}</div>
        <div style="float: right">
            <a  href="{:U('Download/current',array('type'=>'order'))}" class="btn btn-primary">下载当前</a>&nbsp;&nbsp;
            <a  href="{:U('Download/all',array('type'=>'order','s_start_time'=>$s_start_time,'s_end_time'=>$s_end_time,'s_number'=>$s_number,'s_uid'=>$s_uid))}" class="btn btn-primary" onclick="javascript:return confirm_download();">下载全部</a>
        </div>
    </form>
</div>
<script>

    function start_time(){
        WdatePicker({maxDate:"{$a}",onpicking:function(dp){
            $("#h_start_time").val(dp.cal.getNewDateStr());
        }
    });
    }
    function end_time(){
        WdatePicker({minDate:"{$b}",onpicking:function(dp){
            $("#h_end_time").val(dp.cal.getNewDateStr());
        }
        });
    }

    function check_form(){
        var h_start_time = $("#h_start_time").val();
        var h_end_time = $("#h_end_time").val();
        console.log(h_start_time);
        var start_arr = h_start_time.split("-");
        var end_arr = h_end_time.split("-");
        if(start_arr[0] == end_arr[0] && start_arr[1] == end_arr[1]){
            return true;
        }else{
            alert("查询日期必须在同一个月!");return false;
        }
    }


    $(function(){

    });




</script>
<script src="__PUBLIC__/js/common.js"></script>


</body>
</html>